//
//  BindCardOperation.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-29.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddBindCardOperation.h"

@implementation JddBindCardOperation

@synthesize province;
@synthesize city;
@synthesize bank;
@synthesize branchBank;
@synthesize cardNumber, realityName;
@synthesize delegate;

-(id)init{
    self = [super init];
    
    if (self) {
        self.province = [NSString string];
        self.city = [NSString string];
        self.bank = [NSString string];
//        self.branchBank = [NSString string];
        self.cardNumber = [NSString string];
        self.realityName = [NSString string];
    }
    
    return self;
}

-(void)main{
    JddNetDataCommunication *netDataCommunication = [[JddNetDataCommunication alloc] init];
    NSString *bodyString = [JddParameterBuilder bindCardOfProvince:self.province
                                                           city:self.city
                                                           bank:self.bank
                                                     cardNumber:self.cardNumber
                                                         bankId:self.bankId realityName:self.realityName];
    
    NSData *dataBindCard = [netDataCommunication requestDataByPostBodyData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]];
    [((NSObject*)self.delegate) performSelectorOnMainThread:@selector(QueryBindCardOperationResult:) withObject:dataBindCard waitUntilDone:NO];    
}

@end
